unit Colors;

interface

uses
  Database,
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons, ExtCtrls, ComCtrls, Menus;

type
  TFormColors = class(TForm)
    BtnOK: TBitBtn;
    BtnCancel: TBitBtn;
    Label1: TLabel;
    a0: TLabel;
    Label3: TLabel;
    a1: TLabel;
    Label5: TLabel;
    a2: TLabel;
    Label7: TLabel;
    a3: TLabel;
    Label9: TLabel;
    a4: TLabel;
    Label11: TLabel;
    a5: TLabel;
    Label13: TLabel;
    a6: TLabel;
    Label15: TLabel;
    a7: TLabel;
    Label17: TLabel;
    a8: TLabel;
    Label19: TLabel;
    a9: TLabel;
    Label21: TLabel;
    a10: TLabel;
    Label23: TLabel;
    a11: TLabel;
    Label25: TLabel;
    a12: TLabel;
    Label27: TLabel;
    a13: TLabel;
    Label29: TLabel;
    a14: TLabel;
    Label31: TLabel;
    a15: TLabel;
    Label33: TLabel;
    Label34: TLabel;
    Label35: TLabel;
    Label36: TLabel;
    Label37: TLabel;
    Label38: TLabel;
    Label39: TLabel;
    Label40: TLabel;
    Label41: TLabel;
    Label42: TLabel;
    Label43: TLabel;
    Label44: TLabel;
    Label45: TLabel;
    Label46: TLabel;
    Label47: TLabel;
    Label48: TLabel;
    c0: TLabel;
    c1: TLabel;
    c2: TLabel;
    c3: TLabel;
    c4: TLabel;
    c5: TLabel;
    c6: TLabel;
    c7: TLabel;
    c8: TLabel;
    c9: TLabel;
    c10: TLabel;
    c11: TLabel;
    c12: TLabel;
    c13: TLabel;
    c14: TLabel;
    c15: TLabel;
    Bevel1: TBevel;
    DialogColor: TColorDialog;
    BtnHelp: TBitBtn;
    MainMenu: TMainMenu;
    Main2: TMenuItem;
    MenuHelp: TMenuItem;
    BoxDefaults: TGroupBox;
    BtnD1: TBitBtn;
    BtnD3: TBitBtn;
    BtnD4: TBitBtn;
    BtnD5: TBitBtn;
    PanelBack: TPanel;
    BtnColor: TBitBtn;
    LabelDefault: TLabel;
    Bevel2: TBevel;
    BtnD2: TBitBtn;
    BtnD6: TBitBtn;
    b0: TBitBtn;
    b1: TBitBtn;
    b3: TBitBtn;
    b2: TBitBtn;
    b7: TBitBtn;
    b6: TBitBtn;
    b5: TBitBtn;
    b4: TBitBtn;
    b15: TBitBtn;
    b13: TBitBtn;
    b12: TBitBtn;
    b14: TBitBtn;
    b11: TBitBtn;
    b8: TBitBtn;
    b9: TBitBtn;
    b10: TBitBtn;
    BtnDefault: TBitBtn;
    PanelFont: TPanel;
    CheckFixed: TCheckBox;
    BtnFont: TBitBtn;
    DialogFont: TFontDialog;
    CheckTrue: TCheckBox;
    Bevel3: TBevel;
    Label2: TLabel;
    Panel1: TPanel;
    Status: TLabel;
    procedure BtnCancelClick(Sender: TObject);
    procedure c0Click(Sender: TObject);
    procedure BtnColorClick(Sender: TObject);
    procedure BtnOKClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure BtnHelpClick(Sender: TObject);
    procedure BtnD1Click(Sender: TObject);
    procedure b0Click(Sender: TObject);
    procedure BtnFontClick(Sender: TObject);
  private
    { Private declarations }
    procedure LoadValues;
    procedure SaveValues;
    procedure UpdateLabelFonts;
  public
    { Public declarations }
  end;

var
  FormColors: TFormColors;

implementation

{$R *.DFM}

procedure TFormColors.FormCreate(Sender: TObject);
begin
  LoadValues;
end;

procedure TFormColors.BtnCancelClick(Sender: TObject);
begin
  close;
end;

procedure TFormColors.LoadValues;
var h: integer;
begin
  c0.font.color:=Datawell.TableOptions.fieldbyname('Color0').asinteger;
  c1.font.color:=Datawell.TableOptions.fieldbyname('Color1').asinteger;
  c2.font.color:=Datawell.TableOptions.fieldbyname('Color2').asinteger;
  c3.font.color:=Datawell.TableOptions.fieldbyname('Color3').asinteger;
  c4.font.color:=Datawell.TableOptions.fieldbyname('Color4').asinteger;
  c5.font.color:=Datawell.TableOptions.fieldbyname('Color5').asinteger;
  c6.font.color:=Datawell.TableOptions.fieldbyname('Color6').asinteger;
  c7.font.color:=Datawell.TableOptions.fieldbyname('Color7').asinteger;
  c8.font.color:=Datawell.TableOptions.fieldbyname('Color8').asinteger;
  c9.font.color:=Datawell.TableOptions.fieldbyname('Color9').asinteger;
  c10.font.color:=Datawell.TableOptions.fieldbyname('Color10').asinteger;
  c11.font.color:=Datawell.TableOptions.fieldbyname('Color11').asinteger;
  c12.font.color:=Datawell.TableOptions.fieldbyname('Color12').asinteger;
  c13.font.color:=Datawell.TableOptions.fieldbyname('Color13').asinteger;
  c14.font.color:=Datawell.TableOptions.fieldbyname('Color14').asinteger;
  c15.font.color:=Datawell.TableOptions.fieldbyname('Color15').asinteger;
  LabelDefault.font.color:=Datawell.TableOptions.fieldbyname('ColorText').asinteger;
  PanelBack.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  LabelDefault.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  a0.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  a1.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  a2.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  a3.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  a4.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  a5.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  a6.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  a7.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  a8.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  a9.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  a10.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  a11.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  a12.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  a13.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  a14.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  a15.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  c0.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  c1.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  c2.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  c3.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  c4.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  c5.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  c6.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  c7.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  c8.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  c9.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  c10.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  c11.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  c12.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  c13.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  c14.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  c15.color:=Datawell.TableOptions.fieldbyname('ColorScreen').asinteger;
  LabelDefault.font.name:=Datawell.TableOptions.fieldbyname('FontName').asstring;
  h:=Datawell.TableOptions.fieldbyname('FontStyle').asinteger;
  LabelDefault.font.style:=[];
  case h of
    0: LabelDefault.font.style:=[];
    1: LabelDefault.font.style:=[fsbold];
    2: LabelDefault.font.style:=[fsitalic];
    3: LabelDefault.font.style:=[fsbold, fsitalic];
  end;
  UpdateLabelFonts;
end;

procedure TFormColors.SaveValues;
begin
  Datawell.TableOptions.edit;
  Datawell.TableOptions.fieldbyname('Color0').asinteger:=c0.font.color;
  Datawell.TableOptions.fieldbyname('Color1').asinteger:=c1.font.color;
  Datawell.TableOptions.fieldbyname('Color2').asinteger:=c2.font.color;
  Datawell.TableOptions.fieldbyname('Color3').asinteger:=c3.font.color;
  Datawell.TableOptions.fieldbyname('Color4').asinteger:=c4.font.color;
  Datawell.TableOptions.fieldbyname('Color5').asinteger:=c5.font.color;
  Datawell.TableOptions.fieldbyname('Color6').asinteger:=c6.font.color;
  Datawell.TableOptions.fieldbyname('Color7').asinteger:=c7.font.color;
  Datawell.TableOptions.fieldbyname('Color8').asinteger:=c8.font.color;
  Datawell.TableOptions.fieldbyname('Color9').asinteger:=c9.font.color;
  Datawell.TableOptions.fieldbyname('Color10').asinteger:=c10.font.color;
  Datawell.TableOptions.fieldbyname('Color11').asinteger:=c11.font.color;
  Datawell.TableOptions.fieldbyname('Color12').asinteger:=c12.font.color;
  Datawell.TableOptions.fieldbyname('Color13').asinteger:=c13.font.color;
  Datawell.TableOptions.fieldbyname('Color14').asinteger:=c14.font.color;
  Datawell.TableOptions.fieldbyname('Color15').asinteger:=c15.font.color;
  Datawell.TableOptions.fieldbyname('ColorScreen').asinteger:=PanelBack.color;
  Datawell.TableOptions.fieldbyname('ColorText').asinteger:=LabelDefault.font.color;
  Datawell.TableOptions.fieldbyname('FontName').asstring:=LabelDefault.font.name;
  if LabelDefault.font.style = [fsbold] then
    Datawell.TableOptions.fieldbyname('FontStyle').asinteger:=1
  else if LabelDefault.font.style = [fsitalic] then
    Datawell.TableOptions.fieldbyname('FontStyle').asinteger:=2
  else if LabelDefault.font.style = [fsbold, fsitalic] then
    Datawell.TableOptions.fieldbyname('FontStyle').asinteger:=3
  else Datawell.TableOptions.fieldbyname('FontStyle').asinteger:=0;
  Datawell.TableOptions.post;
end;

procedure TFormColors.c0Click(Sender: TObject);
begin
  DialogColor.color:=TLabel(sender).font.color;
  if not DialogColor.execute then exit;
  TLabel(sender).font.color:=DialogColor.color;
end;

procedure TFormColors.BtnColorClick(Sender: TObject);
begin
  DialogColor.color:=PanelBack.color;
  if not DialogColor.execute then exit;
  PanelBack.color:=DialogColor.color;
  a0.color:=DialogColor.color;
  a1.color:=DialogColor.color;
  a2.color:=DialogColor.color;
  a3.color:=DialogColor.color;
  a4.color:=DialogColor.color;
  a5.color:=DialogColor.color;
  a6.color:=DialogColor.color;
  a7.color:=DialogColor.color;
  a8.color:=DialogColor.color;
  a9.color:=DialogColor.color;
  a10.color:=DialogColor.color;
  a11.color:=DialogColor.color;
  a12.color:=DialogColor.color;
  a13.color:=DialogColor.color;
  a14.color:=DialogColor.color;
  a15.color:=DialogColor.color;
  c0.color:=DialogColor.color;
  c1.color:=DialogColor.color;
  c2.color:=DialogColor.color;
  c3.color:=DialogColor.color;
  c4.color:=DialogColor.color;
  c5.color:=DialogColor.color;
  c6.color:=DialogColor.color;
  c7.color:=DialogColor.color;
  c8.color:=DialogColor.color;
  c9.color:=DialogColor.color;
  c10.color:=DialogColor.color;
  c11.color:=DialogColor.color;
  c12.color:=DialogColor.color;
  c13.color:=DialogColor.color;
  c14.color:=DialogColor.color;
  c15.color:=DialogColor.color;
  LabelDefault.color:=DialogColor.color;
end;

procedure TFormColors.BtnOKClick(Sender: TObject);
begin
  SaveValues;
  close;
end;

procedure TFormColors.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  Status.caption:=' '+(sender as TControl).hint;
end;

procedure TFormColors.BtnHelpClick(Sender: TObject);
begin
  Datawell.Help('display_colors');
end;

procedure TFormColors.BtnD1Click(Sender: TObject);
begin
  case TBitBtn(sender).tag of
    1: begin //Black Default
         c0.font.color:=clblack;
         c1.font.color:=clmaroon;
         c2.font.color:=clgreen;
         c3.font.color:=clolive;
         c4.font.color:=clnavy;
         c5.font.color:=clpurple;
         c6.font.color:=clteal;
         c7.font.color:=clsilver;
         c8.font.color:=clgray;
         c9.font.color:=clred;
         c10.font.color:=cllime;
         c11.font.color:=clyellow;
         c12.font.color:=clblue;
         c13.font.color:=clfuchsia;
         c14.font.color:=claqua;
         c15.font.color:=clwhite;
         LabelDefault.font.color:=clsilver;
         PanelBack.color:=clblack;
         a0.color:=clblack;
         a1.color:=clblack;
         a2.color:=clblack;
         a3.color:=clblack;
         a4.color:=clblack;
         a5.color:=clblack;
         a6.color:=clblack;
         a7.color:=clblack;
         a8.color:=clblack;
         a9.color:=clblack;
         a10.color:=clblack;
         a11.color:=clblack;
         a12.color:=clblack;
         a13.color:=clblack;
         a14.color:=clblack;
         a15.color:=clblack;
         c0.color:=clblack;
         c1.color:=clblack;
         c2.color:=clblack;
         c3.color:=clblack;
         c4.color:=clblack;
         c5.color:=clblack;
         c6.color:=clblack;
         c7.color:=clblack;
         c8.color:=clblack;
         c9.color:=clblack;
         c10.color:=clblack;
         c11.color:=clblack;
         c12.color:=clblack;
         c13.color:=clblack;
         c14.color:=clblack;
         c15.color:=clblack;
         LabelDefault.color:=clblack;
       end;
    2: begin //Black Bright
         c0.font.color:=clgray;
         c1.font.color:=clred;
         c2.font.color:=cllime;
         c3.font.color:=clyellow;
         c4.font.color:=clblue;
         c5.font.color:=clfuchsia;
         c6.font.color:=claqua;
         c7.font.color:=clwhite;
         c8.font.color:=clsilver;
         c9.font.color:=clred;
         c10.font.color:=cllime;
         c11.font.color:=clyellow;
         c12.font.color:=clblue;
         c13.font.color:=clfuchsia;
         c14.font.color:=claqua;
         c15.font.color:=clwhite;
         LabelDefault.font.color:=clwhite;
         PanelBack.color:=clblack;
         a0.color:=clblack;
         a1.color:=clblack;
         a2.color:=clblack;
         a3.color:=clblack;
         a4.color:=clblack;
         a5.color:=clblack;
         a6.color:=clblack;
         a7.color:=clblack;
         a8.color:=clblack;
         a9.color:=clblack;
         a10.color:=clblack;
         a11.color:=clblack;
         a12.color:=clblack;
         a13.color:=clblack;
         a14.color:=clblack;
         a15.color:=clblack;
         c0.color:=clblack;
         c1.color:=clblack;
         c2.color:=clblack;
         c3.color:=clblack;
         c4.color:=clblack;
         c5.color:=clblack;
         c6.color:=clblack;
         c7.color:=clblack;
         c8.color:=clblack;
         c9.color:=clblack;
         c10.color:=clblack;
         c11.color:=clblack;
         c12.color:=clblack;
         c13.color:=clblack;
         c14.color:=clblack;
         c15.color:=clblack;
         LabelDefault.color:=clblack;
       end;
    3: begin //Black Dim
         c0.font.color:=clblack;
         c1.font.color:=clmaroon;
         c2.font.color:=clgreen;
         c3.font.color:=clolive;
         c4.font.color:=clnavy;
         c5.font.color:=clpurple;
         c6.font.color:=clteal;
         c7.font.color:=clsilver;
         c8.font.color:=clgray;
         c9.font.color:=clmaroon;
         c10.font.color:=clgreen;
         c11.font.color:=clolive;
         c12.font.color:=clnavy;
         c13.font.color:=clpurple;
         c14.font.color:=clteal;
         c15.font.color:=clsilver;
         LabelDefault.font.color:=clsilver;
         PanelBack.color:=clblack;
         a0.color:=clblack;
         a1.color:=clblack;
         a2.color:=clblack;
         a3.color:=clblack;
         a4.color:=clblack;
         a5.color:=clblack;
         a6.color:=clblack;
         a7.color:=clblack;
         a8.color:=clblack;
         a9.color:=clblack;
         a10.color:=clblack;
         a11.color:=clblack;
         a12.color:=clblack;
         a13.color:=clblack;
         a14.color:=clblack;
         a15.color:=clblack;
         c0.color:=clblack;
         c1.color:=clblack;
         c2.color:=clblack;
         c3.color:=clblack;
         c4.color:=clblack;
         c5.color:=clblack;
         c6.color:=clblack;
         c7.color:=clblack;
         c8.color:=clblack;
         c9.color:=clblack;
         c10.color:=clblack;
         c11.color:=clblack;
         c12.color:=clblack;
         c13.color:=clblack;
         c14.color:=clblack;
         c15.color:=clblack;
         LabelDefault.color:=clblack;
       end;
    4: begin //White Default
         c0.font.color:=clblack;
         c1.font.color:=clmaroon;
         c2.font.color:=clgreen;
         c3.font.color:=clolive;
         c4.font.color:=clnavy;
         c5.font.color:=clpurple;
         c6.font.color:=clteal;
         c7.font.color:=clsilver;
         c8.font.color:=clgray;
         c9.font.color:=clred;
         c10.font.color:=cllime;
         c11.font.color:=clyellow;
         c12.font.color:=clblue;
         c13.font.color:=clfuchsia;
         c14.font.color:=claqua;
         c15.font.color:=clwhite;
         LabelDefault.font.color:=clsilver;
         PanelBack.color:=clwhite;
         a0.color:=clwhite;
         a1.color:=clwhite;
         a2.color:=clwhite;
         a3.color:=clwhite;
         a4.color:=clwhite;
         a5.color:=clwhite;
         a6.color:=clwhite;
         a7.color:=clwhite;
         a8.color:=clwhite;
         a9.color:=clwhite;
         a10.color:=clwhite;
         a11.color:=clwhite;
         a12.color:=clwhite;
         a13.color:=clwhite;
         a14.color:=clwhite;
         a15.color:=clwhite;
         c0.color:=clwhite;
         c1.color:=clwhite;
         c2.color:=clwhite;
         c3.color:=clwhite;
         c4.color:=clwhite;
         c5.color:=clwhite;
         c6.color:=clwhite;
         c7.color:=clwhite;
         c8.color:=clwhite;
         c9.color:=clwhite;
         c10.color:=clwhite;
         c11.color:=clwhite;
         c12.color:=clwhite;
         c13.color:=clwhite;
         c14.color:=clwhite;
         c15.color:=clwhite;
         LabelDefault.color:=clwhite;
       end;
    5: begin //White Bright
         c0.font.color:=clgray;
         c1.font.color:=clred;
         c2.font.color:=cllime;
         c3.font.color:=clyellow;
         c4.font.color:=clblue;
         c5.font.color:=clfuchsia;
         c6.font.color:=claqua;
         c7.font.color:=clsilver;
         c8.font.color:=clsilver;
         c9.font.color:=clred;
         c10.font.color:=cllime;
         c11.font.color:=clyellow;
         c12.font.color:=clblue;
         c13.font.color:=clfuchsia;
         c14.font.color:=claqua;
         c15.font.color:=clwhite;
         LabelDefault.font.color:=clsilver;
         PanelBack.color:=clwhite;
         a0.color:=clwhite;
         a1.color:=clwhite;
         a2.color:=clwhite;
         a3.color:=clwhite;
         a4.color:=clwhite;
         a5.color:=clwhite;
         a6.color:=clwhite;
         a7.color:=clwhite;
         a8.color:=clwhite;
         a9.color:=clwhite;
         a10.color:=clwhite;
         a11.color:=clwhite;
         a12.color:=clwhite;
         a13.color:=clwhite;
         a14.color:=clwhite;
         a15.color:=clwhite;
         c0.color:=clwhite;
         c1.color:=clwhite;
         c2.color:=clwhite;
         c3.color:=clwhite;
         c4.color:=clwhite;
         c5.color:=clwhite;
         c6.color:=clwhite;
         c7.color:=clwhite;
         c8.color:=clwhite;
         c9.color:=clwhite;
         c10.color:=clwhite;
         c11.color:=clwhite;
         c12.color:=clwhite;
         c13.color:=clwhite;
         c14.color:=clwhite;
         c15.color:=clwhite;
         LabelDefault.color:=clwhite;
       end;
    6: begin //White Dim
         c0.font.color:=clgray;
         c1.font.color:=clmaroon;
         c2.font.color:=clgreen;
         c3.font.color:=clolive;
         c4.font.color:=clnavy;
         c5.font.color:=clpurple;
         c6.font.color:=clteal;
         c7.font.color:=clsilver;
         c8.font.color:=clgray;
         c9.font.color:=clmaroon;
         c10.font.color:=clgreen;
         c11.font.color:=clolive;
         c12.font.color:=clnavy;
         c13.font.color:=clpurple;
         c14.font.color:=clteal;
         c15.font.color:=clsilver;
         LabelDefault.font.color:=clgray;
         PanelBack.color:=clwhite;
         a0.color:=clwhite;
         a1.color:=clwhite;
         a2.color:=clwhite;
         a3.color:=clwhite;
         a4.color:=clwhite;
         a5.color:=clwhite;
         a6.color:=clwhite;
         a7.color:=clwhite;
         a8.color:=clwhite;
         a9.color:=clwhite;
         a10.color:=clwhite;
         a11.color:=clwhite;
         a12.color:=clwhite;
         a13.color:=clwhite;
         a14.color:=clwhite;
         a15.color:=clwhite;
         c0.color:=clwhite;
         c1.color:=clwhite;
         c2.color:=clwhite;
         c3.color:=clwhite;
         c4.color:=clwhite;
         c5.color:=clwhite;
         c6.color:=clwhite;
         c7.color:=clwhite;
         c8.color:=clwhite;
         c9.color:=clwhite;
         c10.color:=clwhite;
         c11.color:=clwhite;
         c12.color:=clwhite;
         c13.color:=clwhite;
         c14.color:=clwhite;
         c15.color:=clwhite;
         LabelDefault.color:=clwhite;
       end;
  end;
end;

procedure TFormColors.b0Click(Sender: TObject);
var lab: TLabel;
begin
  case TBitBtn(sender).tag of
    0: lab:=c0;
    1: lab:=c1;
    2: lab:=c2;
    3: lab:=c3;
    4: lab:=c4;
    5: lab:=c5;
    6: lab:=c6;
    7: lab:=c7;
    8: lab:=c8;
    9: lab:=c9;
    10: lab:=c10;
    11: lab:=c11;
    12: lab:=c12;
    13: lab:=c13;
    14: lab:=c14;
    15: lab:=c15;
    999: lab:=LabelDefault;
    else raise Exception.CreateFmt('TFormColors.b0Click: Invalid sender tag: %d', [TBitBtn(sender).tag]);
  end;
  DialogColor.color:=lab.font.color;
  if not DialogColor.execute then exit;
  lab.font.color:=DialogColor.color;
end;

procedure TFormColors.BtnFontClick(Sender: TObject);
begin
  DialogFont.font.name:=LabelDefault.font.name;
  DialogFont.font.size:=10;
  if CheckFixed.checked then begin
    if CheckTrue.checked then
      DialogFont.options:=[fdAnsiOnly,fdTrueTypeOnly,fdFixedPitchOnly,fdForceFontExist]
    else DialogFont.options:=[fdAnsiOnly,fdFixedPitchOnly,fdForceFontExist];
  end
  else begin
    if CheckTrue.checked then
      DialogFont.options:=[fdAnsiOnly,fdTrueTypeOnly,fdForceFontExist,fdLimitSize]
    else DialogFont.options:=[fdAnsiOnly,fdForceFontExist];
  end;
  if DialogFont.execute = false then exit;
  LabelDefault.font.name:=DialogFont.font.name;
  LabelDefault.font.style:=DialogFont.font.style;
  UpdateLabelFonts;
end;

procedure TFormColors.UpdateLabelFonts;
begin
  a0.font.name:=LabelDefault.font.name;
  a1.font.name:=LabelDefault.font.name;
  a2.font.name:=LabelDefault.font.name;
  a3.font.name:=LabelDefault.font.name;
  a4.font.name:=LabelDefault.font.name;
  a5.font.name:=LabelDefault.font.name;
  a6.font.name:=LabelDefault.font.name;
  a7.font.name:=LabelDefault.font.name;
  a8.font.name:=LabelDefault.font.name;
  a9.font.name:=LabelDefault.font.name;
  a10.font.name:=LabelDefault.font.name;
  a11.font.name:=LabelDefault.font.name;
  a12.font.name:=LabelDefault.font.name;
  a13.font.name:=LabelDefault.font.name;
  a14.font.name:=LabelDefault.font.name;
  a15.font.name:=LabelDefault.font.name;
  c0.font.name:=LabelDefault.font.name;
  c1.font.name:=LabelDefault.font.name;
  c2.font.name:=LabelDefault.font.name;
  c3.font.name:=LabelDefault.font.name;
  c4.font.name:=LabelDefault.font.name;
  c5.font.name:=LabelDefault.font.name;
  c6.font.name:=LabelDefault.font.name;
  c7.font.name:=LabelDefault.font.name;
  c8.font.name:=LabelDefault.font.name;
  c9.font.name:=LabelDefault.font.name;
  c10.font.name:=LabelDefault.font.name;
  c11.font.name:=LabelDefault.font.name;
  c12.font.name:=LabelDefault.font.name;
  c13.font.name:=LabelDefault.font.name;
  c14.font.name:=LabelDefault.font.name;
  c15.font.name:=LabelDefault.font.name;
  a0.font.style:=LabelDefault.font.style;
  a1.font.style:=LabelDefault.font.style;
  a2.font.style:=LabelDefault.font.style;
  a3.font.style:=LabelDefault.font.style;
  a4.font.style:=LabelDefault.font.style;
  a5.font.style:=LabelDefault.font.style;
  a6.font.style:=LabelDefault.font.style;
  a7.font.style:=LabelDefault.font.style;
  a8.font.style:=LabelDefault.font.style;
  a9.font.style:=LabelDefault.font.style;
  a10.font.style:=LabelDefault.font.style;
  a11.font.style:=LabelDefault.font.style;
  a12.font.style:=LabelDefault.font.style;
  a13.font.style:=LabelDefault.font.style;
  a14.font.style:=LabelDefault.font.style;
  a15.font.style:=LabelDefault.font.style;
  c0.font.style:=LabelDefault.font.style;
  c1.font.style:=LabelDefault.font.style;
  c2.font.style:=LabelDefault.font.style;
  c3.font.style:=LabelDefault.font.style;
  c4.font.style:=LabelDefault.font.style;
  c5.font.style:=LabelDefault.font.style;
  c6.font.style:=LabelDefault.font.style;
  c7.font.style:=LabelDefault.font.style;
  c8.font.style:=LabelDefault.font.style;
  c9.font.style:=LabelDefault.font.style;
  c10.font.style:=LabelDefault.font.style;
  c11.font.style:=LabelDefault.font.style;
  c12.font.style:=LabelDefault.font.style;
  c13.font.style:=LabelDefault.font.style;
  c14.font.style:=LabelDefault.font.style;
  c15.font.style:=LabelDefault.font.style;
end;

end.
